{include file="public/header" /}
 <link href="/static/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>扣量订单列表</h5>
        </div>
        <div class="ibox-content">
         
                
                
                
                  <div class="row">
                 <form name="admin_list_sea" class="form-search" method="post" action="{:url('lists')}">
                        <div class="col-sm-6">
                            <div class="input-group date" style="width:70%; float:left">
                               
                                <input placeholder="开始日期" name="start" class="form-control layer-date" id="start" >
                                <input placeholder="结束日期" name="end" class="form-control layer-date" id="end">
                        
                            </div>  
                            <div class="input-group">
                                <input type="text" id="key" class="form-control" name="key" value="{$val}" placeholder="输入需查询的代理ID" value="{$val}"/>  
                                  <input type="text" id="ddh" class="form-control" name="ddh" value="{$ddh}" placeholder="请输入订单号" value="{$ddh}"/> 
                                                        
                                <span class="input-group-btn"> 
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button> 
                                </span>
                            </div>
                        </div>
                    </form>
				<div  class="col-sm-7" style="width: 100px">
                    <div class="input-group" >
                        <a href="javascript:;"><button class="btn btn-outline btn-primary" type="button" onclick="del_all_kouliang()">清除指定订单列表</button></a> 
                    </div>
                </div> 
            </div>
            <!--搜索框结束-->
			 <div class="hr-line-dashed"></div>
			   <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th>今日巅峰</th>
                                <th>今日618</th>
                                <th>今日蘑菇</th>
                                <th>今日冈本</th>
                                <th>今日冈本金蝶</th>
                                <th>今日鸡sir</th>
                                
                                <th>昨日巅峰</th>
                                <th>昨日618</th>
                                <th>昨日蘑菇</th>
                                <th>昨日冈本</th>
                                <th>昨日冈本金蝶</th>
                                <th>昨日鸡sir</th>
                            </tr>
                        </thead>
                        <tbody >  
                            <tr class="long-td">
                                
                                <td style="color:red">{if !empty($moneydf)}{$moneydf}元{else}0元{/if}</td>
                                <td style="color:red">{if !empty($money618)}{$money618}元{else}0元{/if}</td>
                                <td style="color:red">{if !empty($moneymg)}{$moneymg}元{else}0元{/if}</td>
                                <td style="color:red">{if !empty($moneygb)}{$moneygb}元{else}0元{/if}</td>
                                <td style="color:red">{if !empty($moneygbjd)}{$moneygbjd}元{else}0元{/if}</td>
                                <td style="color:red">{if !empty($moneyjs)}{$moneyjs}元{else}0元{/if}</td>
                                

                                <td>{if !empty($moneydfz)}{$moneydfz}元{else}0元{/if}</td>
                                <td>{if !empty($money618z)}{$money618z}元{else}0元{/if}</td>
                                <td>{if !empty($moneymgz)}{$moneymgz}元{else}0元{/if}</td>
                                <td>{if !empty($moneygbz)}{$moneygbz}元{else}0元{/if}</td>
                                <td>{if !empty($moneygbjdz)}{$moneygbjdz}元{else}0元{/if}</td>
                                <td>{if !empty($moneyjsz)}{$moneyjsz}元{else}0元{/if}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
								<th>{if !empty($val)}代理id:({$val})_{/if}{if !empty($day)}{$day}{else}今日{/if}扣单笔数</th>
                                <th>{if !empty($val)}代理id:({$val})_{/if}{if !empty($zuori)}{$zuori}{else}昨日{/if}扣单笔数</th>
                                <th>{if !empty($val)}代理id:({$val})_{/if}{if !empty($day)}{$day}{else}今日{/if}扣单总金额</th>
                                <th>{if !empty($val)}代理id:({$val})_{/if}{if !empty($zuori)}{$zuori}{else}昨日{/if}扣单总金额</th>
                                <th>{if !empty($val)}代理id:({$val})_{/if}历史总扣单笔数</th>
								 <th>{if !empty($val)}代理id:({$val})_{/if}历史总扣单金额</th>
                               
                            </tr>
                        </thead>
                       
                          
                           
                        <tbody >  
							
							<tr class="long-td">
								 <td>{$daydd}</td>
                                <td>{$zdd}</td>
                                <td>{if !empty($money1)}{$money1}元{else}0元{/if}</td>
                                <td>{if !empty($money2)}{$money2}元{else}0元{/if}</td>
                                 <td>{$zong}</td>
                               <td>{if !empty($money3)}{$money3}元{else}0元{/if}</td>
							   
                               
                            </tr>
						</tbody>
                    </table>
                  
                </div>
            </div>
			
			
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th>ID</th>
                                <th>代理ID</th>
                                <th>代理名称</th>
                                <th>代理昵称</th>
                                <th>资源名称</th>
                                <th>打赏金额</th>
                                 <th>订单时间</th>
                                <th>订单号</th>
                                <th>微信订单号</th>
                                  <th>短网址</th>
                                <th>禁用ip</th>
                                 <th>禁用短网址</th>
                            </tr>
                        </thead>
                        <script id="list-template" type="text/html">
                            {{# for(var i=0;i<d.length;i++){  }}
                            <tr class="long-td">
                                 <td>{{d[i].id}}</td>
                                <td>{{d[i].userid}}</td>
                                <td>{{d[i].account}}</td>
                                <td>{{d[i].nickname}}</td>
                                <td>
                                <span id="name{{d[i].id}}">******</span> <a onclick="show('{{d[i].id}}','{{d[i].zymc}}')" id='show{{d[i].id}}' style="color:#ff0000">点击显示</a>
                                </td>
                                 <td>{{d[i].money}}</td>
                               <td>{{d[i].shijian}}</td>
                                <td>{{d[i].ddh}}</td>
                                 <td>{{d[i].wxddh}}</td>
                                 
                                 <td style="word-wrap: break-word;word-break: break-all;overflow: hidden;">
                                    <span id="duanw{{d[i].id}}">******</span> <a onclick="duan('{{d[i].id}}','{{d[i].dwz}}')" id='duan{{d[i].id}}' style="color:#ff0000">点击显示</a>
                                </td>
                                 
                                <td>                                  
                                   
                                    <a href="javascript:;" onclick="del_member({{d[i].id}})" class="btn btn-danger btn-outline btn-xs">
                                        <i class="fa fa-trash-o"></i> 禁用</a>                                       
                                </td>
                                <td>   
                                 <a href="javascript:;" onclick="del_dwz({{d[i].id}})" class="btn btn-danger btn-outline btn-xs">
                                    <i class="fa fa-trash-o"></i> 禁用</a>   
                                    </td>
                            </tr>
                            {{# } }}
                        </script>
                        <tbody id="list-content"></tbody>
                    </table>
                    <div id="AjaxPage" style=" text-align: right;"></div>
                    <div id="allpage" style=" text-align: right;"></div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

<!-- 加载动画 -->
<div class="spiner-example">
    <div class="sk-spinner sk-spinner-three-bounce">
        <div class="sk-bounce1"></div>
        <div class="sk-bounce2"></div>
        <div class="sk-bounce3"></div>
    </div>
</div>

{include file="public/footer" /}

  
<script type="text/javascript">
     var start={elem:"#start",format:"YYYY/MM/DD hh:mm:ss",min:"2001-01-01 00:00:00",max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){end.min=datas;end.start=datas}};

    var end={elem:"#end",format:"YYYY/MM/DD hh:mm:ss",min:"2001-01-01 00:00:00",max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){start.max=datas}};
    laydate(start);
    laydate(end);
    //laypage分页
    Ajaxpage();
    function Ajaxpage(curr){
        var key=$('#key').val();
		var riqi=$('#riqi').val();
		var ddh=$('#ddh').val();
        $.getJSON('{:url("lists")}', {page: curr || 1,key:key,riqi:riqi,ddh:ddh}, function(data){
            $(".spiner-example").css('display','none'); //数据加载完关闭动画 
            if(data==''){
                $("#list-content").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
            }else{
                var tpl = document.getElementById('list-template').innerHTML;
                laytpl(tpl).render(data, function(html){
                    document.getElementById('list-content').innerHTML = html;
                });
                laypage({
                    cont: $('#AjaxPage'),//容器。值支持id名、原生dom对象，jquery对象,
                    pages:'{$allpage}',//总页数
                    skip: true,//是否开启跳页
                    skin: '#1AB5B7',//分页组件颜色
                    curr: curr || 1,
                    groups: 3,//连续显示分页数
                    jump: function(obj, first){
                        if(!first){
                            Ajaxpage(obj.curr)
                        }
                        $('#allpage').html('第'+ obj.curr +'页，共'+ obj.pages +'页');
                    }
                });
            }
        });
    }




// function del_all_kouliang(id){
//     dashang.confirm(id,'{:url("del_all_kouliang")}');
// }

function del_all_kouliang(id){
// 	form = document.admin_list_sea;
    var s=$('#start').val();
	var e=$('#end').val();
// 	s=form[0][0].value;
// 	e=form[0][1].value;
    dashang.confirm(id,'{:url("del_all_kouliang")}?start='+s+'&end='+e);
}

function del_member(id){
    dashang.confirm(id,'{:url("del_member")}');
}

function show(id,name) {
var zt = $("#show"+id+"").html();
if(zt=='点击显示'){  
$("#name"+id+"").html(name);
$("#show"+id+"").html('点击隐藏');
}else if(zt=='点击隐藏'){  
$("#name"+id+"").html('****');
$("#show"+id+"").html('点击显示');
}
}

</script>
</body>
</html>